package com.reggie.mapper;

import com.reggie.pojo.Category;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CategoryMapper {
    @Select("SELECT * FROM category")
    List<Category> findAll(int page, int pageSize);

    @Select("SELECT * FROM category WHERE id=#{id}")
    Category findById(Long id);

    @Delete("DELETE FROM category WHERE id=#{id}")
    Integer delete(Long id);

    Integer edit(Category category);

    Integer add(Category category);

    List<Category> findByType(Integer type);
}
